import VueRouter from 'vue-router'

//导入路由所需的组件
import HomeContainer from './component/tabbar/HomeContainer.vue'
import MytbContainer from './component/tabbar/MytbContainer.vue'
import SearchContainer from './component/tabbar/SearchContainer.vue'
import ShopcarContainer from './component/tabbar/ShopcarContainer.vue'

import NewsList from './component/news/NewsList.vue'
import NewsInfo from './component/news/NewsInfo.vue'
import GoodsList from './component/goods/GoodsList.vue'
import GoodsInfo from './component/goods/GoodsInfo.vue'
import GoodsDesc from './component/goods/GoodsDesc.vue'
import GoodsComment from './component/goods/GoodsComment.vue'

import PhotoList from './component/photos/PhotoList.vue'


// 3. 创建路由对象
var router = new VueRouter({
  routes: [//配置路由路径
    {path:'/',redirect:'/home'},//路由重定向
    {path:'/home',component:HomeContainer},           //1.首页
    {path:'/mytaobao',component:MytbContainer},       //2.我的淘宝
    {path:'/shopcar',component:ShopcarContainer},     //3.购物车
    {path:'/search',component:SearchContainer},       //4.搜索
    {path:'/home/goodslist',component:GoodsList},     //1.1  天猫--商品列表页
    {path:'/home/goodsinfo/:id',component:GoodsInfo,name:'goodsinfo'}, //1.1.1  天猫--商品详情页
    {path:'/home/goodsdesc/:id',component:GoodsDesc,name:'goodsdesc'},//1.1.1.1  天猫--商品详情页-图文数据
    {path:'/home/goodscomment/:id',component:GoodsComment,name:'goodscomment'},//1.1.1.2  天猫--商品详情页-商品评论
    {path:'/home/newslist',component:NewsList},       //1.2  新闻资讯--列表页
    {path:'/home/newsinfo/:id',component:NewsInfo},   //1.2.1新闻详情页
    {path:'/home/photolist', component: PhotoList }, //1.3  图片分享页
  ],
  linkActiveClass:'mui-active'//高亮
})

// 把路由对象暴露出去
export default router